-
Notifications
You must be signed in to change notification settings - Fork 0
Organize visualization files into structured subdirectories #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis PR restructures the visualization toolkit by grouping related scripts into dedicated subdirectories (call_graph, dependency_graph, structure_graph, docs), relocates existing modules accordingly, and modernizes the core CodebaseVisualizer with a unified graph-building API, new enums/configs, specialized visualize_* methods and updated CLI support, while adding comprehensive MDX documentation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Hey! 👋 I see one of the checks failed. I am on it! 🫡 |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
|
✅ Fixed the failing pre-commit check in this commit. The issue was related to TRY003 errors in the analyzer.py file, where exception messages were being specified outside the exception class. I've created custom exception classes and removed the inline error messages to fix the issue. 💻 View my work • React 👍 or 👎 |
User description
Description
This PR organizes visualization-related files in the analyzers directory into a structured visualization subdirectory. The files are categorized based on their visualization types:
Directory Structure
call_graph/: Visualizations related to function call relationships and method interactions
call_trace.py: Traces function call paths through a codebasegraph_viz_call_graph.py: Creates directed call graphs for functionsmethod_relationships.py: Visualizes relationships between methods in a classviz_cal_graph.py: Generates call graphs with detailed metadatadependency_graph/: Visualizations related to code dependencies and impact analysis
blast_radius.py: Shows the "blast radius" of changes to a functiondependency_trace.py: Traces symbol dependencies through a codebaseviz_dead_code.py: Identifies and visualizes dead/unused codestructure_graph/: Visualizations related to code structure and organization
graph_viz_dir_tree.py: Displays directory structure as a graphgraph_viz_foreign_key.py: Visualizes database schema relationshipsdocs/: Documentation and examples for visualization tools
codebase-visualization.mdx: Comprehensive guide to codebase visualizationChanges
codebase_visualizer.pyto the visualization directoryThis organization makes it easier to find and use the appropriate visualization tools for different purposes.
💻 View my work • About Codegen
Summary by Sourcery
Organize the visualization tools into structured subdirectories and update the core visualizer and CLI to work with the new layout.
Enhancements:
Documentation:
Chores:
PR Type
Enhancement, Documentation
Description
Refactored and unified the codebase visualization engine, introducing new enums (
VisualizationType,OutputFormat) and aVisualizationConfigdataclass for consistent configuration.Organized visualization-related files into structured subdirectories:
call_graph,dependency_graph,structure_graph, anddocsunderanalyzers/visualization.Added new visualization modules and skills for call graphs, method relationships, function call tracing, blast radius, symbol dependencies, dead code, directory structure, and database foreign key relationships.
Implemented comprehensive test cases and detailed docstrings for visualization modules.
Enhanced documentation with a new README, module-level docstrings, and a detailed MDX guide covering usage, configuration, and workflows for visualization tools.
Updated the CLI and core visualizer to support the new structure and options.
Changes walkthrough 📝
10 files
codebase_visualizer.py
Refactor and unify codebase visualization engine with new featurescodegen-on-oss/codegen_on_oss/analyzers/visualization/codebase_visualizer.py
VisualizationType,OutputFormat) and aVisualizationConfigdataclass for unified configuration.dependency graphs, blast radius, class methods, module dependencies,
dead code, cyclomatic complexity, issues heatmap, and PR comparison.
output, and updates the CLI to support the new structure and options.
graph_viz_call_graph.py
Add call graph visualization skills and test casescodegen-on-oss/codegen_on_oss/analyzers/visualization/call_graph/graph_viz_call_graph.py
networkx.
filtering, and call paths between nodes.
skill.
method_relationships.py
Add class method relationship visualization scriptcodegen-on-oss/codegen_on_oss/analyzers/visualization/call_graph/method_relationships.py
downstream calls.
viz_cal_graph.py
Add detailed call graph visualization with metadatacodegen-on-oss/codegen_on_oss/analyzers/visualization/call_graph/viz_cal_graph.py
function calls.
call_trace.py
Add function call trace and dependency visualizationcodegen-on-oss/codegen_on_oss/analyzers/visualization/call_graph/call_trace.py
dependencies.
blast_radius.py
Add blast radius visualization for function usagescodegen-on-oss/codegen_on_oss/analyzers/visualization/dependency_graph/blast_radius.py
function.
method handlers.
dependency_trace.py
Add symbol dependency trace visualization scriptcodegen-on-oss/codegen_on_oss/analyzers/visualization/dependency_graph/dependency_trace.py
codebase.
viz_dead_code.py
Add dead code visualization skill and graphcodegen-on-oss/codegen_on_oss/analyzers/visualization/dependency_graph/viz_dead_code.py
test files or decorated.
graph_viz_dir_tree.py
Add directory tree structure visualization skillcodegen-on-oss/codegen_on_oss/analyzers/visualization/structure_graph/graph_viz_dir_tree.py
graph.
files.
graph_viz_foreign_key.py
Add foreign key relationship visualization for database modelscodegen-on-oss/codegen_on_oss/analyzers/visualization/structure_graph/graph_viz_foreign_key.py
as a graph.
foreign key relationships.
specific target.
6 files
__init__.py
Add module docstring for call graph visualization packagecodegen-on-oss/codegen_on_oss/analyzers/visualization/call_graph/init.py
visualizations.
__init__.py
Add module docstring for dependency graph visualization packagecodegen-on-oss/codegen_on_oss/analyzers/visualization/dependency_graph/init.py
graph visualizations.
__init__.py
Add module docstring for structure graph visualization packagecodegen-on-oss/codegen_on_oss/analyzers/visualization/structure_graph/init.py
graph visualizations.
__init__.py
Add module docstring for visualization documentation packagecodegen-on-oss/codegen_on_oss/analyzers/visualization/docs/init.py
visualization documentation package.
README.md
Add documentation for visualization directory structure and usagecodegen-on-oss/codegen_on_oss/analyzers/visualization/README.md
structure and usage.
visualizations provided.
codebase-visualization.mdx
Add detailed documentation for codebase visualization tools andworkflowscodegen-on-oss/codegen_on_oss/analyzers/visualization/docs/codebase-visualization.mdx
visualization.
dependency, and blast radius visualizations.
graph iframes.
learning.